Capturing HTML table control property values during playback

You can use the Property statement to capture and return the property values from controls during playback. The returned value can be used anywhere in the script. For example, you can capture the number of rows in a table, store the value in a variable, and use the variable in a For...Next statement to loop through script steps for each table row.

In the following example, QA Wizard Pro returns the value of the Number of Rows property for the Address table in the Contacts window. The value is stored in the ROWS variable.

ROWS = Window("Contacts").HTMLTable("Address").Property("Number of Rows")

The Property statement can also be used with the GetControlFromTable statement to return the property value of a control in an HTML table cell. The GetControlFromTable statement searches a specific table cell for a control and returns the control. It can be used instead of a control name in statements, which allows QA Wizard Pro to dynamically locate the correct control during playback. You can also use the data retrieved using the GetControlFromTable statement to control loops and conditional statements.

In the following example, the GetControlFromTable statement searches for an HTMLLink control in the second row and third column of the Admin table in the Users window.

Window("Users").HTMLTable("Admin").GetControlFromTable("HTMLLink", 2, 3)

Suppose this table cell includes more than one HTMLLink control. In this case, you can also use control properties and expected values to uniquely identify the control you want to find. In the following example, the same statement is used in addition to the Inner Text property and the Details property value. During playback, QA Wizard Pro only returns the control from the cell if the Inner Text property value is Details.

Window("Users").HTMLTable("Admin").GetControlFromTable("HTMLLink", 2, 3, "Inner Text", "Details")